package com.fulu.javabase.singleton;

/**
 * 懒汉式1
 * 不加锁，适合单线程
 */
public class Singleton4 {
    private Singleton4(){}

    private static Singleton4 instance;

    public static Singleton4 getInstance(){
        if(instance == null){
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            instance = new Singleton4();
        }
        return instance;
    }
}
